<?php $this->load->view('inc/header'); ?>

<!-- ajax -->
<script type="text/javascript">

$(window).load(function ()
	{
		$("#choose_staff2").hide();
		$("#but_assign").hide();
	}
);
$(function(){
	$("select#staff_id").change(function(){
		var url="<?=base_url()?>administrator/staff_profiles";
		var dataSet={member_id: $("#staff_id").val() };
		$('#choose_staff2').empty().html('<p><center><img src="<?=base_url()?>images/ajax-loader.gif"/></center></p>');
		$.post(url,dataSet,function(data){
    		//alert("Success "+dataSet.staff_id+dataSet.org_id);
			$("#choose_staff2").fadeIn(1500);
			$("#but_assign").fadeIn(1500);
			$("#choose_staff2").html(data);
 		 });
	});
});

$(function(){
	$("#but_assign_staff").click(function(){
		var url="<?=base_url()?>administrator/assign_staff_db";
		var dataSet={staff_id: $("#staff_id").val(), org_id: $("#org_id").val() };
		$('#choose_staff2').empty().html('<p><center><img src="<?=base_url()?>images/ajax-loader.gif"/></center></p>');
		$.post(url,dataSet,function(data){
    		//alert("Success "+dataSet.staff_id+dataSet.org_id);
			$("#choose_staff2").html(data);
 		 });
	});
});
</script>

<?php
$this->db->where('org_id',$id);
$query = $this->db->get('organization');
foreach($query->result() as $rows){
	$org_name = $rows->org_name;
}
?>
<div class="grid_12" style="background-color:#CCCCCC;">
  <!--เมนูข้าง-->
  <div class="grid_4 alpha" style="margin-top:10px;">
    <div id="side-panel-top">
      <div style="padding-left: 22px; padding-top: 11px; font-weight: bold;   color:#FF9933; text-shadow: 1px 1px 1px rgb(255, 255, 255);">Management</div>
    </div>
    <div id="side-panel-middle" style="padding-left: 22px;">
      <ul id="browser" class="filetree">
        <li class="closed"><img src="<?=base_url()?>images/graphic/sitemap-application-blue.png" /> <span>Organization</span>
          <ul>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/users.png" /><span> <a href="<?=base_url()?>administrator/org/manage-staff">Manage Staff</a></span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/folder-open-document.png" /><span> <a href="<?=base_url()?>administrator/org/manage-news">Manage Content</a></span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/table-sum.png" /><span> <a href="<?=base_url()?>administrator/org/statistics">Statistics</a></span></li>
          </ul>
        </li>
        <li class="closed"><img src="<?=base_url()?>images/graphic/balloon-twitter-retweet.png" /> <span>CopS</span>
          <ul>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/link.png" /><span> Manage Staff</span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/folder-open-document.png" /><span> Manage Content</span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/table-sum.png" /><span> Statistics</span></li>
          </ul>
        </li>
        <li class="closed"><img src="<?=base_url()?>images/graphic/balloon-quotation.png" /> <span>Blogs</span>
          <ul>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/link.png" /><span> Manage Staff</span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/folder-open-document.png" /><span> Manage Content</span></li>
            <li>&nbsp;<img src="<?=base_url()?>images/graphic/table-sum.png" /><span> Statistics</span></li>
          </ul>
        </li>
        <li class="closed"> this is closed! <img src="<?=base_url()?>images/folder.gif" />
          <ul>
            <li><img src="<?=base_url()?>images/file.gif" /></li>
          </ul>
        </li>
        <li><img src="<?=base_url()?>images/file.gif" /></li>
      </ul>
    </div>
    <div id="side-panel-bottom"></div>
    <!--เมนูข้าง-->
    <div class="grid_4 alpha" style="margin-top:8px;">
      <div id="side-panel-top">
        <div style="padding-left: 22px; padding-top: 11px; font-weight: bold;   color:#FF9933; text-shadow: 1px 1px 1px rgb(255, 255, 255);">Search</div>
      </div>
      <div id="side-panel-middle"> dsf</div>
      <div id="side-panel-bottom"></div>
    </div>
    <!--ปิดเมนูข้าง-->
  </div>
  <!--ปิดเมนูข้าง-->
  <div class="grid_8 omega" style="margin-top:10px;">
    <div id="km-topic">
      <div style="padding-left: 19px; padding-top: 11px; color: rgb(0, 0, 0); font-weight: bold; text-shadow: 1px 1px 1px rgb(255, 255, 255);">
        <?=$topic?><?=$org_name?>
      </div>
    </div>
    <div id="km-new-middle" style="height:auto;">
        <div id="choose_staff" style="background:#E8E8E8; padding:5px; width:565px;">
        <form name ="" method="post" action="">
        <span><img src="<?=base_url()?>images/graphic/users.png"/>&nbsp;
        <select name="staff_id" id="staff_id">
        <?php
			$query = $this->db->get('membership');
			foreach($query->result() as $rows){
				$member_id = $rows->member_id;
				$firstname = $rows->firstname;
				$lastname = $rows->lastname;
		?>
        	<option value="<?=$member_id?>"><?=$firstname?> <?=$lastname?></option>
        <?php		
			}
		?>
        </select>
        <input type="hidden" value="<?=$id?>" name="org_id" id="org_id">
        </span>
        </form>
        </div>
        <div id="choose_staff2" style="-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px; background:#DBEE99; padding:5px; width:565px; height:50px; margin-top:5px;"></div>
<!-- But Assign div-->
<div id="but_assign">
  <br/>
<a href="#" style="-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px; background:#666666; padding:3px; color:#FFFFFF; text-decoration:none;">view profile</a>&nbsp;

<a href="#" id="but_assign_staff" style="-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px; background:#FF9900; padding:3px; color:#333333; text-decoration:none;">assign to staff</a>
</div>
<!-- end but div -->
    </div>
    <div id="km-new-bottom"></div>
  </div>  
</div>
<div class="clear"></div>
<!--end content1-->
<div class="grid_12" style="background-color:#CCCCCC;">&nbsp;</div>
<div class="clear"></div>
<?php $this->load->view('inc/footer'); ?>
